package com.lianniu.web.demand.service.impl;

import com.lianniu.web.base.BaseResult;
import com.lianniu.web.demand.dao.DemandDetailDao;
import com.lianniu.web.demand.service.DemandDetailService;
import com.lianniu.web.demand.vo.DemandDetailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017-05-14.
 */
@Service
public class DemandDetailServiceImpl implements DemandDetailService {

    @Autowired
    DemandDetailDao demandDetailDao;
    @Override
    public BaseResult insertSelective(DemandDetailVo record) {
        int in = this.demandDetailDao.insertSelective(record);
        return BaseResult.success(in);
    }

    @Override
    public BaseResult selectByPrimaryKey(Long id) {
        DemandDetailVo demandDetailVo = this.demandDetailDao.selectByPrimaryKey(id);
        return BaseResult.success(demandDetailVo);
    }

    @Override
    public BaseResult selectByDemandId(Long id) {
        List<DemandDetailVo> list = this.demandDetailDao.selectByDemandId(id);
        return BaseResult.success(list);
    }

    @Override
    public BaseResult updateByPrimaryKeySelective(DemandDetailVo record) {
        int up = this.demandDetailDao.updateByPrimaryKeySelective(record);
        return BaseResult.success(up);
    }
}
